#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

void* pf1(void* arg)
{
    int j = 0;
    while(1)
    {
        printf("j=%d\n",j++);
        sleep(1);
    }
}

void* pf2(void* arg)
{
    int k = 0;
    while(1)
    {
        printf("k=%d\n",k++);
        sleep(1);
    }
}

int main(int argc, char const *argv[])
{
    pthread_t tid1;
    pthread_t tid2;
    pthread_create(&tid1,NULL,pf1,NULL);
    pthread_create(&tid2,NULL,pf2,NULL);

    int i = 0;
    while(1)
    {
        printf("i=;%d\n",i++);
        sleep(1);
    }
    return 0;
}
